home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch1f < prev    next >
Encoding:
Internet Message Format  |  1989-08-08  |  51.0 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v07i099:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch1f
  5. Message-ID: <4393@tekred.CNA.TEK.COM>
  6. Date: 3 Aug 89 17:00:44 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 1891
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 7, Issue 99
  13. Archive-name: NetHack3/Patch1f
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 6 (of 6)."
  25. # Contents:  src4.diff
  26. # Wrapped by billr@saab on Thu Aug  3 09:57:48 1989
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'src4.diff' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'src4.diff'\"
  30. else
  31. echo shar: Extracting \"'src4.diff'\" \(48599 characters\)
  32. sed "s/^X//" >'src4.diff' <<'END_OF_FILE'
  33. XSource patches, part 4 and final
  34. X
  35. X-----------------------------------Cut---------------------------------
  36. X*** src/Old/shk.c    Mon Jul 31 14:40:35 1989
  37. X--- src/shk.c    Thu Jul 27 11:37:49 1989
  38. X***************
  39. X*** 386,392 ****
  40. X  register struct monst *shkp;
  41. X  {
  42. X      long robbed = ESHK(shkp)->robbed;
  43. X!     long balance = ((tmp <= 0) ? tmp : check_credit(tmp, shkp));
  44. X  
  45. X      u.ugold -= balance;
  46. X      shkp->mgold += balance;
  47. X--- 386,392 ----
  48. X  register struct monst *shkp;
  49. X  {
  50. X      long robbed = ESHK(shkp)->robbed;
  51. X!     long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp));
  52. X  
  53. X      u.ugold -= balance;
  54. X      shkp->mgold += balance;
  55. X***************
  56. X*** 393,399 ****
  57. X      flags.botl = 1;
  58. X      if(robbed) {
  59. X          robbed -= tmp;
  60. X!         if(robbed < 0) robbed = 0;
  61. X          ESHK(shkp)->robbed = robbed;
  62. X      }
  63. X  }
  64. X--- 393,399 ----
  65. X      flags.botl = 1;
  66. X      if(robbed) {
  67. X          robbed -= tmp;
  68. X!         if(robbed < 0) robbed = 0L;
  69. X          ESHK(shkp)->robbed = robbed;
  70. X      }
  71. X  }
  72. X***************
  73. X*** 421,427 ****
  74. X  
  75. X      NOTANGRY(shkp) = 1;
  76. X      ESHK(shkp)->following = 0;
  77. X!     ESHK(shkp)->robbed = 0;
  78. X      if (pl_character[0] != 'R')
  79. X          adjalign(sgn(u.ualigntyp));
  80. X      if(!inhishop(shkp)) {
  81. X--- 421,427 ----
  82. X  
  83. X      NOTANGRY(shkp) = 1;
  84. X      ESHK(shkp)->following = 0;
  85. X!     ESHK(shkp)->robbed = 0L;
  86. X      if (pl_character[0] != 'R')
  87. X          adjalign(sgn(u.ualigntyp));
  88. X      if(!inhishop(shkp)) {
  89. X***************
  90. X*** 477,483 ****
  91. X              You("give %s all your gold.", mon_nam(shkp));
  92. X              pay(u.ugold, shkp);
  93. X              }
  94. X!             if(ugold < ltmp/2)
  95. X              pline("Unfortunately, %s doesn't look satisfied.",
  96. X                  ESHK(shkp)->ismale ? "he" : "she");
  97. X              else
  98. X--- 477,483 ----
  99. X              You("give %s all your gold.", mon_nam(shkp));
  100. X              pay(u.ugold, shkp);
  101. X              }
  102. X!             if(ugold < ltmp/2L)
  103. X              pline("Unfortunately, %s doesn't look satisfied.",
  104. X                  ESHK(shkp)->ismale ? "he" : "she");
  105. X              else
  106. X***************
  107. X*** 487,499 ****
  108. X      }
  109. X  
  110. X      /* ltmp is still ESHK(shkp)->robbed here */
  111. X!     if(!ESHK(shkp)->billct) {
  112. X          if(!ltmp && NOTANGRY(shkp)) {
  113. X              You("do not owe %s anything.", mon_nam(shkp));
  114. X              if(!u.ugold) pline(no_money);
  115. X          } else if(ltmp) {
  116. X              pline("%s is after blood, not money!", mon_nam(shkp));
  117. X!             if(u.ugold < ltmp/2) {
  118. X              if(!u.ugold) pline(no_money);
  119. X              else pline("Besides, you don't have enough to interest %s.",
  120. X                  ESHK(shkp)->ismale ? "him" : "her");
  121. X--- 487,499 ----
  122. X      }
  123. X  
  124. X      /* ltmp is still ESHK(shkp)->robbed here */
  125. X!     if(!ESHK(shkp)->billct && !ESHK(shkp)->debit) {
  126. X          if(!ltmp && NOTANGRY(shkp)) {
  127. X              You("do not owe %s anything.", mon_nam(shkp));
  128. X              if(!u.ugold) pline(no_money);
  129. X          } else if(ltmp) {
  130. X              pline("%s is after blood, not money!", mon_nam(shkp));
  131. X!             if(u.ugold < ltmp/2L) {
  132. X              if(!u.ugold) pline(no_money);
  133. X              else pline("Besides, you don't have enough to interest %s.",
  134. X                  ESHK(shkp)->ismale ? "him" : "her");
  135. X***************
  136. X*** 512,518 ****
  137. X               * door broken, attacked, etc. */
  138. X              pline("%s is after your hide, not your money!",
  139. X                      mon_nam(shkp));
  140. X!             if(u.ugold < 1000) {
  141. X              if(!u.ugold) pline(no_money);
  142. X              else
  143. X          pline("Besides, you don't have enough to interest %s.",
  144. X--- 512,518 ----
  145. X               * door broken, attacked, etc. */
  146. X              pline("%s is after your hide, not your money!",
  147. X                      mon_nam(shkp));
  148. X!             if(u.ugold < 1000L) {
  149. X              if(!u.ugold) pline(no_money);
  150. X              else
  151. X          pline("Besides, you don't have enough to interest %s.",
  152. X***************
  153. X*** 618,624 ****
  154. X      }
  155. X      obj->unpaid = 0;
  156. X      ltmp = bp->price * bp->bquan;
  157. X!     if(ANGRY(shopkeeper)) ltmp += ltmp/3;
  158. X      if(u.ugold + ESHK(shopkeeper)->credit < ltmp){
  159. X          You("don't have gold%s enough to pay for %s.",
  160. X              (ESHK(shopkeeper)->credit > 0L) ? " or credit" : "",
  161. X--- 618,624 ----
  162. X      }
  163. X      obj->unpaid = 0;
  164. X      ltmp = bp->price * bp->bquan;
  165. X!     if(ANGRY(shopkeeper)) ltmp += ltmp/3L;
  166. X      if(u.ugold + ESHK(shopkeeper)->credit < ltmp){
  167. X          You("don't have gold%s enough to pay for %s.",
  168. X              (ESHK(shopkeeper)->credit > 0L) ? " or credit" : "",
  169. X***************
  170. X*** 647,653 ****
  171. X  boolean
  172. X  paybill(){
  173. X      register struct monst *mtmp;
  174. X!     register int loss = 0;
  175. X      register struct obj *otmp;
  176. X      register xchar ox, oy;
  177. X      register boolean take = FALSE;
  178. X--- 647,653 ----
  179. X  boolean
  180. X  paybill(){
  181. X      register struct monst *mtmp;
  182. X!     register long loss = 0L;
  183. X      register struct obj *otmp;
  184. X      register xchar ox, oy;
  185. X      register boolean take = FALSE;
  186. X***************
  187. X*** 666,680 ****
  188. X      /* shopkeeper is peaceful, nothing stolen, nothing owed. */
  189. X      if(in_shop(u.ux,u.uy) && !IS_DOOR(levl[u.ux][u.uy].typ) &&
  190. X          !ESHK(shopkeeper)->billct && !ESHK(shopkeeper)->robbed &&
  191. X!         inhishop(shopkeeper) && NOTANGRY(shopkeeper) &&
  192. X!         !ESHK(shopkeeper)->following) {
  193. X          pline("%s gratefully inherits all your possessions.",
  194. X                  Monnam(shopkeeper));
  195. X          goto clear;
  196. X      }
  197. X  
  198. X!     if(ESHK(shopkeeper)->billct || ESHK(shopkeeper)->robbed) {
  199. X          addupbill();
  200. X          loss = ((total >= ESHK(shopkeeper)->robbed) ? total :
  201. X                  ESHK(shopkeeper)->robbed);
  202. X          take = TRUE;
  203. X--- 666,682 ----
  204. X      /* shopkeeper is peaceful, nothing stolen, nothing owed. */
  205. X      if(in_shop(u.ux,u.uy) && !IS_DOOR(levl[u.ux][u.uy].typ) &&
  206. X          !ESHK(shopkeeper)->billct && !ESHK(shopkeeper)->robbed &&
  207. X!         !ESHK(shopkeeper)->debit && inhishop(shopkeeper) && 
  208. X!          NOTANGRY(shopkeeper) && !ESHK(shopkeeper)->following) {
  209. X          pline("%s gratefully inherits all your possessions.",
  210. X                  Monnam(shopkeeper));
  211. X          goto clear;
  212. X      }
  213. X  
  214. X!     if(ESHK(shopkeeper)->billct || ESHK(shopkeeper)->debit ||
  215. X!             ESHK(shopkeeper)->robbed) {
  216. X          addupbill();
  217. X+         total += ESHK(shopkeeper)->debit;
  218. X          loss = ((total >= ESHK(shopkeeper)->robbed) ? total :
  219. X                  ESHK(shopkeeper)->robbed);
  220. X          take = TRUE;
  221. X***************
  222. X*** 686,692 ****
  223. X                      Monnam(shopkeeper));
  224. X              taken = TRUE;
  225. X              shopkeeper->mgold += u.ugold;
  226. X!             u.ugold = 0;
  227. X              /* in case bones: make it be for real... */
  228. X              if(!in_shop(u.ux, u.uy) || IS_DOOR(levl[u.ux][u.uy].typ)) {
  229. X                  /* shk.x,shk.y is the position immediately in
  230. X--- 688,694 ----
  231. X                      Monnam(shopkeeper));
  232. X              taken = TRUE;
  233. X              shopkeeper->mgold += u.ugold;
  234. X!             u.ugold = 0L;
  235. X              /* in case bones: make it be for real... */
  236. X              if(!in_shop(u.ux, u.uy) || IS_DOOR(levl[u.ux][u.uy].typ)) {
  237. X                  /* shk.x,shk.y is the position immediately in
  238. X***************
  239. X*** 768,775 ****
  240. X  {
  241. X      register long tmp;
  242. X  
  243. X!     tmp = getprice(obj);
  244. X!     if (!tmp) tmp = 5;
  245. X      if (ANGRY(shopkeeper) || 
  246. X          (pl_character[0] == 'T' && u.ulevel < (MAXULEV/2))
  247. X  #ifdef SHIRT
  248. X--- 770,777 ----
  249. X  {
  250. X      register long tmp;
  251. X  
  252. X!     tmp = (long) getprice(obj);
  253. X!     if (!tmp) tmp = 5L;
  254. X      if (ANGRY(shopkeeper) || 
  255. X          (pl_character[0] == 'T' && u.ulevel < (MAXULEV/2))
  256. X  #ifdef SHIRT
  257. X***************
  258. X*** 776,788 ****
  259. X          || (uarmu && !uarm) /* wearing just a Hawaiian shirt */
  260. X  #endif
  261. X         )
  262. X!         tmp += tmp/3;
  263. X!     if (ACURR(A_CHA) > 18)        tmp /= 2;
  264. X!     else if (ACURR(A_CHA) > 17)    tmp = (tmp * 2)/3;
  265. X!     else if (ACURR(A_CHA) > 15)    tmp = (tmp * 3)/4;
  266. X!     else if (ACURR(A_CHA) < 11)    tmp = (tmp * 4)/3;
  267. X!     else if (ACURR(A_CHA) < 8)    tmp = (tmp * 3)/2;
  268. X!     else if (ACURR(A_CHA) < 6)    tmp *= 2;
  269. X      return(tmp);
  270. X  }
  271. X  
  272. X--- 778,790 ----
  273. X          || (uarmu && !uarm) /* wearing just a Hawaiian shirt */
  274. X  #endif
  275. X         )
  276. X!         tmp += tmp/3L;
  277. X!     if (ACURR(A_CHA) > 18)        tmp /= 2L;
  278. X!     else if (ACURR(A_CHA) > 17)    tmp = (tmp * 2L)/3L;
  279. X!     else if (ACURR(A_CHA) > 15)    tmp = (tmp * 3L)/4L;
  280. X!     else if (ACURR(A_CHA) < 11)    tmp = (tmp * 4L)/3L;
  281. X!     else if (ACURR(A_CHA) < 8)    tmp = (tmp * 3L)/2L;
  282. X!     else if (ACURR(A_CHA) < 6)    tmp *= 2L;
  283. X      return(tmp);
  284. X  }
  285. X  
  286. X***************
  287. X*** 891,902 ****
  288. X  register struct obj *obj;
  289. X  {
  290. X      long ltmp;
  291. X-     /* register int tmp;    /* use of tmp commented out below */
  292. X-     register struct obj *otmp;
  293. X      register struct bill_x *bp;
  294. X      if(!costly_spot(u.ux,u.uy))
  295. X          return;
  296. X      if((bp = onbill(obj)) != 0) {
  297. X          obj->unpaid = 0;
  298. X          if(bp->bquan > obj->quan){
  299. X              otmp = newobj(0);
  300. X--- 893,905 ----
  301. X  register struct obj *obj;
  302. X  {
  303. X      long ltmp;
  304. X      register struct bill_x *bp;
  305. X+ 
  306. X      if(!costly_spot(u.ux,u.uy))
  307. X          return;
  308. X      if((bp = onbill(obj)) != 0) {
  309. X+         register struct obj *otmp;
  310. X+ 
  311. X          obj->unpaid = 0;
  312. X          if(bp->bquan > obj->quan){
  313. X              otmp = newobj(0);
  314. X***************
  315. X*** 923,932 ****
  316. X      /* he dropped something of his own - probably wants to sell it */
  317. X      if(shopkeeper->msleep || shopkeeper->mfroz || !inhishop(shopkeeper))
  318. X          return;
  319. X!     ltmp = getprice(obj) * obj->quan;
  320. X      if(ESHK(shopkeeper)->billct == BILLSZ
  321. X         || !saleable(rooms[ESHK(shopkeeper)->shoproom].rtype-SHOPBASE, obj)
  322. X!        || otmp->olet == BALL_SYM || ltmp == 0L) {
  323. X          pline("%s seems not interested.", Monnam(shopkeeper));
  324. X          obj->no_charge = 1;
  325. X          return;
  326. X--- 926,935 ----
  327. X      /* he dropped something of his own - probably wants to sell it */
  328. X      if(shopkeeper->msleep || shopkeeper->mfroz || !inhishop(shopkeeper))
  329. X          return;
  330. X!     ltmp = (long) getprice(obj) * (long) obj->quan;
  331. X      if(ESHK(shopkeeper)->billct == BILLSZ
  332. X         || !saleable(rooms[ESHK(shopkeeper)->shoproom].rtype-SHOPBASE, obj)
  333. X!        || obj->olet == BALL_SYM || ltmp == 0L) {
  334. X          pline("%s seems not interested.", Monnam(shopkeeper));
  335. X          obj->no_charge = 1;
  336. X          return;
  337. X***************
  338. X*** 936,947 ****
  339. X          || (uarmu && !uarm) /* wearing just a Hawaiian shirt */
  340. X  #endif
  341. X         ) {
  342. X!         ltmp /= 3;
  343. X          NOTANGRY(shopkeeper) = 1;
  344. X!     } else    ltmp /= 2;
  345. X      if(ESHK(shopkeeper)->robbed) {
  346. X!         if((ESHK(shopkeeper)->robbed -= ltmp) < 0)
  347. X!             ESHK(shopkeeper)->robbed = 0;
  348. X  pline("\"Thank you for your contribution to restock this recently plundered shop.\"");
  349. X          return;
  350. X      }
  351. X--- 939,950 ----
  352. X          || (uarmu && !uarm) /* wearing just a Hawaiian shirt */
  353. X  #endif
  354. X         ) {
  355. X!         ltmp /= 3L;
  356. X          NOTANGRY(shopkeeper) = 1;
  357. X!     } else    ltmp /= 2L;
  358. X      if(ESHK(shopkeeper)->robbed) {
  359. X!         if((ESHK(shopkeeper)->robbed -= ltmp) < 0L)
  360. X!             ESHK(shopkeeper)->robbed = 0L;
  361. X  pline("\"Thank you for your contribution to restock this recently plundered shop.\"");
  362. X          return;
  363. X      }
  364. X***************
  365. X*** 986,992 ****
  366. X      if(page_line("Unpaid articles already used up:") || page_line(""))
  367. X          goto quit;
  368. X  
  369. X!     totused = 0;
  370. X      for(bp = bill; bp - bill < ESHK(shopkeeper)->billct; bp++) {
  371. X          obj = bp_to_obj(bp);
  372. X          if(!obj) {
  373. X--- 989,995 ----
  374. X      if(page_line("Unpaid articles already used up:") || page_line(""))
  375. X          goto quit;
  376. X  
  377. X!     totused = 0L;
  378. X      for(bp = bill; bp - bill < ESHK(shopkeeper)->billct; bp++) {
  379. X          obj = bp_to_obj(bp);
  380. X          if(!obj) {
  381. X***************
  382. X*** 1047,1053 ****
  383. X              tmp = 0;
  384. X          break;
  385. X      case ARMOR_SYM:
  386. X-         if (u.uac > 0) tmp += u.uac * 2;
  387. X      case WEAPON_SYM:
  388. X          if (obj->spe > 0) tmp += 10 * obj->spe;
  389. X          break;
  390. X--- 1050,1055 ----
  391. X***************
  392. X*** 1156,1162 ****
  393. X              uondoor = (u.ux == ESHK(shkp)->shd.x &&
  394. X                  u.uy == ESHK(shkp)->shd.y);
  395. X              if(uondoor) {
  396. X!             if(ESHK(shkp)->billct && inhishop(shkp))
  397. X                  pline(NOTANGRY(shkp) ?
  398. X                  "\"Hello, %s!  Will you please pay before leaving?\"" :
  399. X                  "\"Hey, %s!  Don't leave without paying!\"",
  400. X--- 1158,1165 ----
  401. X              uondoor = (u.ux == ESHK(shkp)->shd.x &&
  402. X                  u.uy == ESHK(shkp)->shd.y);
  403. X              if(uondoor) {
  404. X!             if((ESHK(shkp)->billct || ESHK(shkp)->debit) 
  405. X!                     && inhishop(shkp))
  406. X                  pline(NOTANGRY(shkp) ?
  407. X                  "\"Hello, %s!  Will you please pay before leaving?\"" :
  408. X                  "\"Hey, %s!  Don't leave without paying!\"",
  409. X***************
  410. X*** 1170,1176 ****
  411. X              badinv = FALSE;
  412. X              }
  413. X  
  414. X!             if(((!ESHK(shkp)->robbed && !ESHK(shkp)->billct) || avoid)
  415. X              && GDIST(omx,omy) < 3) {
  416. X              if(!badinv && !online(omx,omy))
  417. X                  return(0);
  418. X--- 1173,1180 ----
  419. X              badinv = FALSE;
  420. X              }
  421. X  
  422. X!             if(((!ESHK(shkp)->robbed && !ESHK(shkp)->billct &&
  423. X!                 !ESHK(shkp)->debit) || avoid)
  424. X              && GDIST(omx,omy) < 3) {
  425. X              if(!badinv && !online(omx,omy))
  426. X                  return(0);
  427. X***************
  428. X*** 1263,1281 ****
  429. X      register int kcnt = (cnt / 9);        /* and maybe a kaptain */
  430. X  
  431. X      while(cnt--) {
  432. X!         enexto(mm, mm->x, mm->y);
  433. X          (void) makemon(&mons[PM_KEYSTONE_KOP], mm->x, mm->y);
  434. X      }
  435. X      while(scnt--) {
  436. X!         enexto(mm, mm->x, mm->y);
  437. X          (void) makemon(&mons[PM_KOP_SERGEANT], mm->x, mm->y);
  438. X      }
  439. X      while(lcnt--) {
  440. X!         enexto(mm, mm->x, mm->y);
  441. X          (void) makemon(&mons[PM_KOP_LIEUTENANT], mm->x, mm->y);
  442. X      }
  443. X      while(kcnt--) {
  444. X!         enexto(mm, mm->x, mm->y);
  445. X          (void) makemon(&mons[PM_KOP_KAPTAIN], mm->x, mm->y);
  446. X      }
  447. X      return(cnt + scnt + lcnt + kcnt);
  448. X--- 1267,1285 ----
  449. X      register int kcnt = (cnt / 9);        /* and maybe a kaptain */
  450. X  
  451. X      while(cnt--) {
  452. X!         enexto(mm, mm->x, mm->y, &mons[PM_KEYSTONE_KOP]);
  453. X          (void) makemon(&mons[PM_KEYSTONE_KOP], mm->x, mm->y);
  454. X      }
  455. X      while(scnt--) {
  456. X!         enexto(mm, mm->x, mm->y, &mons[PM_KOP_SERGEANT]);
  457. X          (void) makemon(&mons[PM_KOP_SERGEANT], mm->x, mm->y);
  458. X      }
  459. X      while(lcnt--) {
  460. X!         enexto(mm, mm->x, mm->y, &mons[PM_KOP_LIEUTENANT]);
  461. X          (void) makemon(&mons[PM_KOP_LIEUTENANT], mm->x, mm->y);
  462. X      }
  463. X      while(kcnt--) {
  464. X!         enexto(mm, mm->x, mm->y, &mons[PM_KOP_KAPTAIN]);
  465. X          (void) makemon(&mons[PM_KOP_KAPTAIN], mm->x, mm->y);
  466. X      }
  467. X      return(cnt + scnt + lcnt + kcnt);
  468. X***************
  469. X*** 1353,1359 ****
  470. X  
  471. X      if(um_dist(x, y, 1)) goto chase;
  472. X  
  473. X!     if(u.ugold < damage || !rn2(50)) {
  474. X  chase:
  475. X          if(um_dist(x, y, 1))
  476. X              pline("%s shouts: \"Who dared %s my door?\"",
  477. X--- 1357,1363 ----
  478. X  
  479. X      if(um_dist(x, y, 1)) goto chase;
  480. X  
  481. X!     if(u.ugold < (long) damage || !rn2(50)) {
  482. X  chase:
  483. X          if(um_dist(x, y, 1))
  484. X              pline("%s shouts: \"Who dared %s my door?\"",
  485. X***************
  486. X*** 1366,1373 ****
  487. X  
  488. X      pline("\"Cad!  You did %d zorkmids worth of damage!\"  Pay? ", damage);
  489. X      if(yn() != 'n') {
  490. X!         u.ugold -= damage;
  491. X!         shopkeeper->mgold += damage;
  492. X          flags.botl = 1;
  493. X          pline("Mollified, %s accepts your restitution.",
  494. X              shkname(shopkeeper));
  495. X--- 1370,1377 ----
  496. X  
  497. X      pline("\"Cad!  You did %d zorkmids worth of damage!\"  Pay? ", damage);
  498. X      if(yn() != 'n') {
  499. X!         u.ugold -= (long) damage;
  500. X!         shopkeeper->mgold += (long) damage;
  501. X          flags.botl = 1;
  502. X          pline("Mollified, %s accepts your restitution.",
  503. X              shkname(shopkeeper));
  504. X***************
  505. X*** 1433,1439 ****
  506. X      register long tmp = get_cost(otmp);
  507. X  
  508. X      /* The idea is to make the exhaustive use of */
  509. X!     /* an unpaid item more expansive than buying */
  510. X      /* outright.                     */
  511. X      if(otmp->otyp == MAGIC_LAMP) {             /* 1 */
  512. X          tmp += (tmp/3L);
  513. X--- 1437,1443 ----
  514. X      register long tmp = get_cost(otmp);
  515. X  
  516. X      /* The idea is to make the exhaustive use of */
  517. X!     /* an unpaid item more expensive than buying */
  518. X      /* outright.                     */
  519. X      if(otmp->otyp == MAGIC_LAMP) {             /* 1 */
  520. X          tmp += (tmp/3L);
  521. X*** src/Old/shknam.c    Mon Jul 31 14:41:46 1989
  522. X--- src/shknam.c    Sun Jul 30 18:57:44 1989
  523. X***************
  524. X*** 268,285 ****
  525. X      ESHK(shk)->shd = doors[sh];
  526. X      ESHK(shk)->shk.x = sx;
  527. X      ESHK(shk)->shk.y = sy;
  528. X!     /* makemon() has already zeroed out all the extra space
  529. X!     ESHK(shk)->robbed = 0;
  530. X!     ESHK(shk)->credit = 0;
  531. X!     ESHK(shk)->debit = 0;
  532. X      ESHK(shk)->visitct = 0;
  533. X      ESHK(shk)->following = 0;
  534. X      ESHK(shk)->billct = 0;
  535. X!     */
  536. X!     shk->mgold = 1000 + 30*rnd(100);    /* initial capital */
  537. X      if (shp->shknms == shktools) {
  538. X          static int who;
  539. X!         who = rn2(sizeof(shktools)/sizeof(char *));
  540. X          if (who==21) ESHK(shk)->ismale = FALSE;
  541. X          else ESHK(shk)->ismale = TRUE;
  542. X          (void) strncpy(ESHK(shk)->shknam, shp->shknms[who], PL_NSIZ);
  543. X--- 268,283 ----
  544. X      ESHK(shk)->shd = doors[sh];
  545. X      ESHK(shk)->shk.x = sx;
  546. X      ESHK(shk)->shk.y = sy;
  547. X!     ESHK(shk)->robbed = 0L;
  548. X!     ESHK(shk)->credit = 0L;
  549. X!     ESHK(shk)->debit = 0L;
  550. X      ESHK(shk)->visitct = 0;
  551. X      ESHK(shk)->following = 0;
  552. X      ESHK(shk)->billct = 0;
  553. X!     shk->mgold = 1000L + 30L*(long)rnd(100);    /* initial capital */
  554. X      if (shp->shknms == shktools) {
  555. X          static int who;
  556. X!         who = rn2(sizeof(shktools)/sizeof(char *) - 1);
  557. X          if (who==21) ESHK(shk)->ismale = FALSE;
  558. X          else ESHK(shk)->ismale = TRUE;
  559. X          (void) strncpy(ESHK(shk)->shknam, shp->shknms[who], PL_NSIZ);
  560. X*** src/Old/sounds.c    Mon Jul 31 14:42:44 1989
  561. X--- src/sounds.c    Sat Jul 29 12:04:51 1989
  562. X***************
  563. X*** 585,591 ****
  564. X      }
  565. X  
  566. X      tx = u.ux+u.dx; ty = u.uy+u.dy;
  567. X!     if (!cansee(tx,ty) || !levl[tx][ty].mmask || (mtmp = m_at(tx, ty))->mimic) {
  568. X      pline("I see nobody there.");
  569. X      return(0);
  570. X      }
  571. X--- 585,592 ----
  572. X      }
  573. X  
  574. X      tx = u.ux+u.dx; ty = u.uy+u.dy;
  575. X!     if ((Blind && !Telepat) || !levl[tx][ty].mmask ||
  576. X!         (mtmp = m_at(tx, ty))->mimic || mtmp->mundetected) {
  577. X      pline("I see nobody there.");
  578. X      return(0);
  579. X      }
  580. X*** src/Old/spell.c    Mon Jul 31 14:43:48 1989
  581. X--- src/spell.c    Mon Jul 24 14:47:30 1989
  582. X***************
  583. X*** 297,303 ****
  584. X          energy *= rnd(6);
  585. X      }
  586. X      if(energy > u.uen)  {
  587. X!         You("are too weak to cast that spell.");
  588. X          return(0);
  589. X      } else    if ((u.uhunger <= 100 && spell != SPE_DETECT_FOOD) ||
  590. X                          (ACURR(A_STR) < 6))  {
  591. X--- 297,303 ----
  592. X          energy *= rnd(6);
  593. X      }
  594. X      if(energy > u.uen)  {
  595. X!         You("don't have enough energy to cast that spell.");
  596. X          return(0);
  597. X      } else    if ((u.uhunger <= 100 && spell != SPE_DETECT_FOOD) ||
  598. X                          (ACURR(A_STR) < 6))  {
  599. X*** src/Old/termcap.c    Mon Jul 31 14:44:47 1989
  600. X--- src/termcap.c    Mon Jul 31 09:13:43 1989
  601. X***************
  602. X*** 17,22 ****
  603. X--- 17,28 ----
  604. X  short    ospeed = 0;    /* gets around "not defined" error message */
  605. X  #endif
  606. X  
  607. X+ #ifdef MICROPORT_286_BUG
  608. X+ #define Tgetstr(key) (tgetstr(key,tbuf))
  609. X+ #else
  610. X+ #define Tgetstr(key) (tgetstr(key,&tbufptr))
  611. X+ #endif /* MICROPORT_286_BUG **/
  612. X+ 
  613. X  static void nocmov();
  614. X  #ifdef MSDOSCOLOR
  615. X  static void init_hilite();
  616. X***************
  617. X*** 44,50 ****
  618. X  void
  619. X  startup()
  620. X  {
  621. X! #ifdef TOS
  622. X      HO = "\033H";
  623. X      CL = "\033E";        /* the VT52 termcap */
  624. X      CE = "\033K";
  625. X--- 50,56 ----
  626. X  void
  627. X  startup()
  628. X  {
  629. X! #if defined(TOS) && !defined(TERMLIB)
  630. X      HO = "\033H";
  631. X      CL = "\033E";        /* the VT52 termcap */
  632. X      CE = "\033K";
  633. X***************
  634. X*** 63,71 ****
  635. X      char *tbufptr, *pc;
  636. X      register int i;
  637. X  
  638. X-     tptr = (char *) alloc(1024);
  639. X- 
  640. X-     tbufptr = tbuf;
  641. X      if(!(term = getenv("TERM")))
  642. X  # ifdef ANSI_DEFAULT
  643. X      {
  644. X--- 69,74 ----
  645. X***************
  646. X*** 80,86 ****
  647. X          BC = "\033[D";
  648. X          HI = SO = "\033[1m";
  649. X          US = "\033[4m";
  650. X!         TI = HE = SE = UE = "\033[0m";
  651. X          /* strictly, SE should be 2, and UE should be 24,
  652. X             but we can't trust all ANSI emulators to be
  653. X             that complete.  -3. */
  654. X--- 83,90 ----
  655. X          BC = "\033[D";
  656. X          HI = SO = "\033[1m";
  657. X          US = "\033[4m";
  658. X!         MR = "\033[7m";
  659. X!         TI = HE = SE = UE = ME = "\033[0m";
  660. X          /* strictly, SE should be 2, and UE should be 24,
  661. X             but we can't trust all ANSI emulators to be
  662. X             that complete.  -3. */
  663. X***************
  664. X*** 87,106 ****
  665. X          AS = "\016";
  666. X          AE = "\017";
  667. X          VS = VE = "";
  668. X!     } else {
  669. X  # else
  670. X          error("Can't get TERM.");
  671. X  # endif
  672. X      if(!strncmp(term, "5620", 4))
  673. X          flags.nonull = 1;    /* this should be a termcap flag */
  674. X      if(tgetent(tptr, term) < 1)
  675. X          error("Unknown terminal type: %s.", term);
  676. X!     if(pc = tgetstr("pc", &tbufptr))
  677. X          PC = *pc;
  678. X  #ifdef TERMINFO
  679. X!     if(!(BC = tgetstr("le", &tbufptr))) {    
  680. X  #else
  681. X!     if(!(BC = tgetstr("bc", &tbufptr))) {    
  682. X  #endif
  683. X  #if !defined(MINIMAL_TERM) && !defined(HISX)
  684. X          if(!tgetflag("bs"))
  685. X--- 91,126 ----
  686. X          AS = "\016";
  687. X          AE = "\017";
  688. X          VS = VE = "";
  689. X! #  ifdef MSDOSCOLOR
  690. X!         HI_WHITE = HI;
  691. X!         HI_RED = "\033[1;31m";
  692. X!         HI_YELLOW = "\033[1;33m";
  693. X!         HI_GREEN = "\033[1;32m";
  694. X!         HI_BLUE = "\033[1;34m";
  695. X! #  endif
  696. X!         return;
  697. X!     }
  698. X  # else
  699. X+ #  if defined(TOS) && defined(__GNUC__)        /* library has a default */
  700. X+         term = "st52";
  701. X+ #  else
  702. X          error("Can't get TERM.");
  703. X+ #  endif
  704. X  # endif
  705. X+ 
  706. X+     tptr = (char *) alloc(1024);
  707. X+ 
  708. X+     tbufptr = tbuf;
  709. X      if(!strncmp(term, "5620", 4))
  710. X          flags.nonull = 1;    /* this should be a termcap flag */
  711. X      if(tgetent(tptr, term) < 1)
  712. X          error("Unknown terminal type: %s.", term);
  713. X!     if(pc = Tgetstr("pc"))
  714. X          PC = *pc;
  715. X  #ifdef TERMINFO
  716. X!     if(!(BC = Tgetstr("le"))) {    
  717. X  #else
  718. X!     if(!(BC = Tgetstr("bc"))) {    
  719. X  #endif
  720. X  #if !defined(MINIMAL_TERM) && !defined(HISX)
  721. X          if(!tgetflag("bs"))
  722. X***************
  723. X*** 113,159 ****
  724. X  #ifdef MINIMAL_TERM
  725. X      HO = NULL;
  726. X  #else
  727. X!     HO = tgetstr("ho", &tbufptr);
  728. X  #endif
  729. X      CO = tgetnum("co");
  730. X      LI = tgetnum("li");
  731. X!     if(CO < COLNO || LI < ROWNO+2)
  732. X          setclipped();
  733. X!     if(!(CL = tgetstr("cl", &tbufptr)))
  734. X          error("Hack needs CL.");
  735. X!     ND = tgetstr("nd", &tbufptr);
  736. X      if(tgetflag("os"))
  737. X          error("Hack can't have OS.");
  738. X!     CE = tgetstr("ce", &tbufptr);
  739. X!     UP = tgetstr("up", &tbufptr);
  740. X      /* It seems that xd is no longer supported, and we should use
  741. X         a linefeed instead; unfortunately this requires resetting
  742. X         CRMOD, and many output routines will have to be modified
  743. X         slightly. Let's leave that till the next release. */
  744. X!     XD = tgetstr("xd", &tbufptr);
  745. X! /* not:         XD = tgetstr("do", &tbufptr); */
  746. X!     if(!(CM = tgetstr("cm", &tbufptr))) {
  747. X          if(!UP && !HO)
  748. X              error("Hack needs CM or UP or HO.");
  749. X          Printf("Playing hack on terminals without cm is suspect...\n");
  750. X          getret();
  751. X      }
  752. X!     SO = tgetstr("so", &tbufptr);
  753. X!     SE = tgetstr("se", &tbufptr);
  754. X!     US = tgetstr("us", &tbufptr);
  755. X!     UE = tgetstr("ue", &tbufptr);
  756. X      SG = tgetnum("sg");    /* -1: not fnd; else # of spaces left by so */
  757. X      if(!SO || !SE || (SG > 0)) SO = SE = US = UE = "";
  758. X!     TI = tgetstr("ti", &tbufptr);
  759. X!     TE = tgetstr("te", &tbufptr);
  760. X      VS = VE = "";
  761. X  #if 0
  762. X!     MB = tgetstr("mb", &tbufptr);    /* blink */
  763. X!     MD = tgetstr("md", &tbufptr);    /* boldface */
  764. X!     MH = tgetstr("mh", &tbufptr);    /* dim */
  765. X  #endif
  766. X!     MR = tgetstr("mr", &tbufptr);    /* reverse */
  767. X!     ME = tgetstr("me", &tbufptr);
  768. X  
  769. X      /* Get rid of padding numbers for HI and HE.  Hope they
  770. X       * aren't really needed!!!  HI and HE are ouputted to the
  771. X--- 133,179 ----
  772. X  #ifdef MINIMAL_TERM
  773. X      HO = NULL;
  774. X  #else
  775. X!     HO = Tgetstr("ho");
  776. X  #endif
  777. X      CO = tgetnum("co");
  778. X      LI = tgetnum("li");
  779. X!     if(CO < COLNO || LI < ROWNO+3)
  780. X          setclipped();
  781. X!     if(!(CL = Tgetstr("cl")))
  782. X          error("Hack needs CL.");
  783. X!     ND = Tgetstr("nd");
  784. X      if(tgetflag("os"))
  785. X          error("Hack can't have OS.");
  786. X!     CE = Tgetstr("ce");
  787. X!     UP = Tgetstr("up");
  788. X      /* It seems that xd is no longer supported, and we should use
  789. X         a linefeed instead; unfortunately this requires resetting
  790. X         CRMOD, and many output routines will have to be modified
  791. X         slightly. Let's leave that till the next release. */
  792. X!     XD = Tgetstr("xd");
  793. X! /* not:         XD = Tgetstr("do"); */
  794. X!     if(!(CM = Tgetstr("cm"))) {
  795. X          if(!UP && !HO)
  796. X              error("Hack needs CM or UP or HO.");
  797. X          Printf("Playing hack on terminals without cm is suspect...\n");
  798. X          getret();
  799. X      }
  800. X!     SO = Tgetstr("so");
  801. X!     SE = Tgetstr("se");
  802. X!     US = Tgetstr("us");
  803. X!     UE = Tgetstr("ue");
  804. X      SG = tgetnum("sg");    /* -1: not fnd; else # of spaces left by so */
  805. X      if(!SO || !SE || (SG > 0)) SO = SE = US = UE = "";
  806. X!     TI = Tgetstr("ti");
  807. X!     TE = Tgetstr("te");
  808. X      VS = VE = "";
  809. X  #if 0
  810. X!     MB = Tgetstr("mb");    /* blink */
  811. X!     MD = Tgetstr("md");    /* boldface */
  812. X!     MH = Tgetstr("mh");    /* dim */
  813. X  #endif
  814. X!     MR = Tgetstr("mr");    /* reverse */
  815. X!     ME = Tgetstr("me");
  816. X  
  817. X      /* Get rid of padding numbers for HI and HE.  Hope they
  818. X       * aren't really needed!!!  HI and HE are ouputted to the
  819. X***************
  820. X*** 168,185 ****
  821. X          i = 0;
  822. X          while(isdigit(SE[i])) i++;
  823. X          Strcpy(HE, &SE[i]);
  824. X!     AS = tgetstr("as", &tbufptr);
  825. X!     AE = tgetstr("ae", &tbufptr);
  826. X!     CD = tgetstr("cd", &tbufptr);
  827. X! # ifdef ANSI_DEFAULT
  828. X!     }
  829. X! # endif
  830. X      set_whole_screen();        /* uses LI and CD */
  831. X      if(tbufptr-tbuf > sizeof(tbuf)) error("TERMCAP entry too big...\n");
  832. X      free((genericptr_t)tptr);
  833. X! #ifdef MSDOSCOLOR
  834. X      init_hilite();
  835. X! #endif
  836. X  #endif /* TOS /* */
  837. X  }
  838. X  
  839. X--- 188,202 ----
  840. X          i = 0;
  841. X          while(isdigit(SE[i])) i++;
  842. X          Strcpy(HE, &SE[i]);
  843. X!     AS = Tgetstr("as");
  844. X!     AE = Tgetstr("ae");
  845. X!     CD = Tgetstr("cd");
  846. X      set_whole_screen();        /* uses LI and CD */
  847. X      if(tbufptr-tbuf > sizeof(tbuf)) error("TERMCAP entry too big...\n");
  848. X      free((genericptr_t)tptr);
  849. X! # ifdef MSDOSCOLOR
  850. X      init_hilite();
  851. X! # endif
  852. X  #endif /* TOS /* */
  853. X  }
  854. X  
  855. X*** src/Old/topten.c    Mon Jul 31 14:46:14 1989
  856. X--- src/topten.c    Sat Jul 29 21:26:29 1989
  857. X***************
  858. X*** 6,12 ****
  859. X  #define MONATTK_H
  860. X  #include "hack.h"
  861. X  
  862. X! #include <errno.h>      /* George Barbanis */
  863. X  
  864. X  static char *itoa P((int)), *ordin P((int));
  865. X  static void outheader();
  866. X--- 6,15 ----
  867. X  #define MONATTK_H
  868. X  #include "hack.h"
  869. X  
  870. X! #include <errno.h>    /* George Barbanis */
  871. X! #ifdef NO_FILE_LINKS
  872. X! #include <fcntl.h>    /* Ralf Brown */
  873. X! #endif
  874. X  
  875. X  static char *itoa P((int)), *ordin P((int));
  876. X  static void outheader();
  877. X***************
  878. X*** 42,48 ****
  879. X      char *recfile = RECORD;
  880. X  #ifdef UNIX
  881. X      char *reclock = "record_lock";
  882. X! #endif
  883. X      int sleepct = 300;
  884. X      FILE *rfile;
  885. X      register int flg = 0;
  886. X--- 45,54 ----
  887. X      char *recfile = RECORD;
  888. X  #ifdef UNIX
  889. X      char *reclock = "record_lock";
  890. X! # ifdef NO_FILE_LINKS
  891. X!     int lockfd ;
  892. X! # endif
  893. X! #endif /* UNIX */
  894. X      int sleepct = 300;
  895. X      FILE *rfile;
  896. X      register int flg = 0;
  897. X***************
  898. X*** 49,58 ****
  899. X  #ifdef LOGFILE
  900. X      char *lgfile = LOGFILE;
  901. X      FILE *lfile;
  902. X! #ifdef UNIX
  903. X      char *loglock = "logfile_lock";
  904. X      int sleeplgct = 30;
  905. X! #endif /* UNIX */
  906. X  #endif /* LOGFILE */
  907. X  
  908. X  #ifdef MSDOS
  909. X--- 55,64 ----
  910. X  #ifdef LOGFILE
  911. X      char *lgfile = LOGFILE;
  912. X      FILE *lfile;
  913. X! # ifdef UNIX
  914. X      char *loglock = "logfile_lock";
  915. X      int sleeplgct = 30;
  916. X! # endif /* UNIX */
  917. X  #endif /* LOGFILE */
  918. X  
  919. X  #ifdef MSDOS
  920. X***************
  921. X*** 62,68 ****
  922. X--- 68,83 ----
  923. X  #endif
  924. X  
  925. X  #ifdef UNIX
  926. X+ # ifdef NO_FILE_LINKS
  927. X+     reclock = (char *)alloc(sizeof(LOCKDIR)+1+strlen(recfile)+7);
  928. X+     Strcpy(reclock,LOCKDIR) ;
  929. X+     Strcat(reclock,"/") ;
  930. X+     Strcat(reclock,recfile) ;
  931. X+     Strcat(reclock,"_lock") ;
  932. X+     while ((lockfd = open(reclock,O_RDWR|O_CREAT|O_EXCL,0666)) == -1) {
  933. X+ # else
  934. X      while(link(recfile, reclock) == -1) {
  935. X+ # endif /* NO_FILE_LINKS */
  936. X          HUP perror(reclock);
  937. X          if(!sleepct--) {
  938. X              HUP (void) puts("I give up.  Sorry.");
  939. X***************
  940. X*** 72,87 ****
  941. X          HUP Printf("Waiting for access to record file. (%d)\n",
  942. X              sleepct);
  943. X          HUP (void) fflush(stdout);
  944. X! #if defined(SYSV) || defined(ULTRIX)
  945. X          (void)
  946. X! #endif
  947. X              sleep(1);
  948. X      }
  949. X! #endif
  950. X      if(!(rfile = fopen(recfile,"r"))){
  951. X          HUP (void) puts("Cannot open record file!");
  952. X          goto unlock;
  953. X      }
  954. X      HUP (void) putchar('\n');
  955. X  
  956. X      /* create a new 'topten' entry */
  957. X--- 87,105 ----
  958. X          HUP Printf("Waiting for access to record file. (%d)\n",
  959. X              sleepct);
  960. X          HUP (void) fflush(stdout);
  961. X! # if defined(SYSV) || defined(ULTRIX)
  962. X          (void)
  963. X! # endif
  964. X              sleep(1);
  965. X      }
  966. X! #endif /* UNIX */
  967. X      if(!(rfile = fopen(recfile,"r"))){
  968. X          HUP (void) puts("Cannot open record file!");
  969. X          goto unlock;
  970. X      }
  971. X+ #ifdef NO_FILE_LINKS
  972. X+     (void) close(lockfd) ;
  973. X+ #endif
  974. X      HUP (void) putchar('\n');
  975. X  
  976. X      /* create a new 'topten' entry */
  977. X***************
  978. X*** 103,110 ****
  979. X      /* assure minimum number of points */
  980. X      if(t0->points < POINTSMIN) t0->points = 0;
  981. X  #ifdef LOGFILE        /* used for debugging (who dies of what, where) */
  982. X! #ifdef UNIX
  983. X      while(link(lgfile, loglock) == -1) {
  984. X          extern int errno;
  985. X  
  986. X          if (errno == ENOENT) /* If no such file, do not keep log */
  987. X--- 121,137 ----
  988. X      /* assure minimum number of points */
  989. X      if(t0->points < POINTSMIN) t0->points = 0;
  990. X  #ifdef LOGFILE        /* used for debugging (who dies of what, where) */
  991. X! # ifdef UNIX
  992. X! #  ifdef NO_FILE_LINKS
  993. X!     loglock = (char *)alloc(sizeof(LOCKDIR)+1+strlen(lgfile)+6);
  994. X!     Strcpy(loglock,LOCKDIR) ;
  995. X!     Strcat(loglock,"/") ;
  996. X!     Strcat(loglock,lgfile) ;
  997. X!     Strcat(loglock,"_lock") ;
  998. X!     while ((lockfd = open(loglock,O_RDWR|O_CREAT|O_EXCL,0666)) == -1) {
  999. X! #  else
  1000. X      while(link(lgfile, loglock) == -1) {
  1001. X+ #  endif /* NO_FILE_LINKS */
  1002. X          extern int errno;
  1003. X  
  1004. X          if (errno == ENOENT) /* If no such file, do not keep log */
  1005. X***************
  1006. X*** 118,129 ****
  1007. X          HUP Printf("Waiting for access to log file. (%d)\n",
  1008. X               sleeplgct);
  1009. X          HUP (void) fflush(stdout);
  1010. X! #if defined(SYSV) || defined(ULTRIX)
  1011. X          (void)
  1012. X! #endif
  1013. X              sleep(1);
  1014. X      }
  1015. X! #endif /* UNIX */
  1016. X      if(!(lfile = fopen(lgfile,"a"))){
  1017. X          HUP (void) puts("Cannot open log file!");
  1018. X          goto lgend;
  1019. X--- 145,156 ----
  1020. X          HUP Printf("Waiting for access to log file. (%d)\n",
  1021. X               sleeplgct);
  1022. X          HUP (void) fflush(stdout);
  1023. X! #  if defined(SYSV) || defined(ULTRIX)
  1024. X          (void)
  1025. X! #  endif
  1026. X              sleep(1);
  1027. X      }
  1028. X! # endif /* UNIX */
  1029. X      if(!(lfile = fopen(lgfile,"a"))){
  1030. X          HUP (void) puts("Cannot open log file!");
  1031. X          goto lgend;
  1032. X***************
  1033. X*** 134,143 ****
  1034. X          t0->hp, t0->maxhp, t0->points,
  1035. X          t0->plchar, t0->sex, t0->name, t0->death);
  1036. X      (void) fclose(lfile);
  1037. X! #ifdef UNIX
  1038. X      (void) unlink(loglock);
  1039. X! #endif /* UNIX */
  1040. X        lgend:;
  1041. X  #endif /* LOGFILE */
  1042. X  
  1043. X      t1 = tt_head = newttentry();
  1044. X--- 161,173 ----
  1045. X          t0->hp, t0->maxhp, t0->points,
  1046. X          t0->plchar, t0->sex, t0->name, t0->death);
  1047. X      (void) fclose(lfile);
  1048. X! # ifdef UNIX
  1049. X      (void) unlink(loglock);
  1050. X! # endif /* UNIX */
  1051. X        lgend:;
  1052. X+ # ifdef NO_FILE_LINKS
  1053. X+     (void) close(lockfd) ;
  1054. X+ # endif
  1055. X  #endif /* LOGFILE */
  1056. X  
  1057. X      t1 = tt_head = newttentry();
  1058. X***************
  1059. X*** 144,150 ****
  1060. X      tprev = 0;
  1061. X      /* rank0: -1 undefined, 0 not_on_list, n n_th on list */
  1062. X      for(rank = 1; ; ) {
  1063. X! #ifdef TOS
  1064. X          char k1[2],k2[2];
  1065. X          if(fscanf(rfile, "%6s %d %d %d %d %d %ld %1s%1s %s %s]",
  1066. X  #else
  1067. X--- 174,180 ----
  1068. X      tprev = 0;
  1069. X      /* rank0: -1 undefined, 0 not_on_list, n n_th on list */
  1070. X      for(rank = 1; ; ) {
  1071. X! #ifdef OLD_TOS
  1072. X          char k1[2],k2[2];
  1073. X          if(fscanf(rfile, "%6s %d %d %d %d %d %ld %1s%1s %s %s]",
  1074. X  #else
  1075. X***************
  1076. X*** 153,159 ****
  1077. X          t1->date, &t1->uid,
  1078. X          &t1->level, &t1->maxlvl,
  1079. X          &t1->hp, &t1->maxhp, &t1->points,
  1080. X! #ifdef TOS
  1081. X          k1, k2,
  1082. X  #else
  1083. X          &t1->plchar, &t1->sex,
  1084. X--- 183,189 ----
  1085. X          t1->date, &t1->uid,
  1086. X          &t1->level, &t1->maxlvl,
  1087. X          &t1->hp, &t1->maxhp, &t1->points,
  1088. X! #ifdef OLD_TOS
  1089. X          k1, k2,
  1090. X  #else
  1091. X          &t1->plchar, &t1->sex,
  1092. X***************
  1093. X*** 161,167 ****
  1094. X          t1->name, t1->death) != 11 || t1->points < POINTSMIN)
  1095. X              t1->points = 0;
  1096. X  
  1097. X! #ifdef TOS
  1098. X          t1->plchar=k1[0];
  1099. X          t1->sex=k2[0];
  1100. X  #endif
  1101. X--- 191,197 ----
  1102. X          t1->name, t1->death) != 11 || t1->points < POINTSMIN)
  1103. X              t1->points = 0;
  1104. X  
  1105. X! #ifdef OLD_TOS
  1106. X          t1->plchar=k1[0];
  1107. X          t1->sex=k2[0];
  1108. X  #endif
  1109. X***************
  1110. X*** 259,265 ****
  1111. X      (void) fclose(rfile);
  1112. X  unlock:    ;
  1113. X  #ifdef UNIX
  1114. X!     (void) unlink(reclock);
  1115. X  #endif
  1116. X  }
  1117. X  
  1118. X--- 289,299 ----
  1119. X      (void) fclose(rfile);
  1120. X  unlock:    ;
  1121. X  #ifdef UNIX
  1122. X! # ifdef NO_FILE_LINKS
  1123. X!     (void) close(lockfd) ;
  1124. X! # endif
  1125. X!     if (unlink(reclock) < 0)
  1126. X!         Printf("Can't unlink %s\n",reclock) ;
  1127. X  #endif
  1128. X  }
  1129. X  
  1130. X***************
  1131. X*** 330,335 ****
  1132. X--- 364,370 ----
  1133. X      if(iskilled) Sprintf(eos(linebuf), " by %s%s",
  1134. X        (!strncmp(t1->death, "trick", 5) || !strncmp(t1->death, "the ", 4)
  1135. X         || !strncmp(t1->death, "Mr. ", 4) || !strncmp(t1->death, "Ms. ", 4)
  1136. X+        || !strncmp(eos(t1->death)-4, "tion", 4)
  1137. X         ) ? "" :
  1138. X        index(vowels,*t1->death) ? "an " : "a ",
  1139. X        t1->death);
  1140. X***************
  1141. X*** 463,469 ****
  1142. X  
  1143. X      t1 = tt_head = newttentry();
  1144. X      for(rank = 1; ; rank++) {
  1145. X! #ifdef TOS
  1146. X        char k1[2], k2[2];
  1147. X        if(fscanf(rfile, "%6s %d %d %d %d %d %ld %1s%1s %s %s]",
  1148. X  #else
  1149. X--- 498,504 ----
  1150. X  
  1151. X      t1 = tt_head = newttentry();
  1152. X      for(rank = 1; ; rank++) {
  1153. X! #ifdef OLD_TOS
  1154. X        char k1[2], k2[2];
  1155. X        if(fscanf(rfile, "%6s %d %d %d %d %d %ld %1s%1s %s %s]",
  1156. X  #else
  1157. X***************
  1158. X*** 472,478 ****
  1159. X          t1->date, &t1->uid,
  1160. X          &t1->level, &t1->maxlvl,
  1161. X          &t1->hp, &t1->maxhp, &t1->points,
  1162. X! #ifdef TOS
  1163. X          k1, k2,
  1164. X  #else
  1165. X          &t1->plchar, &t1->sex,
  1166. X--- 507,513 ----
  1167. X          t1->date, &t1->uid,
  1168. X          &t1->level, &t1->maxlvl,
  1169. X          &t1->hp, &t1->maxhp, &t1->points,
  1170. X! #ifdef OLD_TOS
  1171. X          k1, k2,
  1172. X  #else
  1173. X          &t1->plchar, &t1->sex,
  1174. X***************
  1175. X*** 480,486 ****
  1176. X          t1->name, t1->death) != 11)
  1177. X              t1->points = 0;
  1178. X        if(t1->points == 0) break;
  1179. X! #ifdef TOS
  1180. X        t1->plchar=k1[0];
  1181. X        t1->sex=k2[0];
  1182. X  #endif
  1183. X--- 515,521 ----
  1184. X          t1->name, t1->death) != 11)
  1185. X              t1->points = 0;
  1186. X        if(t1->points == 0) break;
  1187. X! #ifdef OLD_TOS
  1188. X        t1->plchar=k1[0];
  1189. X        t1->sex=k2[0];
  1190. X  #endif
  1191. X***************
  1192. X*** 609,615 ****
  1193. X      rank = rnd(10);
  1194. X  pickentry:
  1195. X      for(i = rank; i; i--) {
  1196. X! #ifdef TOS
  1197. X        char k1[2], k2[2];
  1198. X        if(fscanf(rfile, "%6s %d %d %d %d %d %ld %1s%1s %s %s]",
  1199. X  #else
  1200. X--- 644,650 ----
  1201. X      rank = rnd(10);
  1202. X  pickentry:
  1203. X      for(i = rank; i; i--) {
  1204. X! #ifdef OLD_TOS
  1205. X        char k1[2], k2[2];
  1206. X        if(fscanf(rfile, "%6s %d %d %d %d %d %ld %1s%1s %s %s]",
  1207. X  #else
  1208. X***************
  1209. X*** 618,624 ****
  1210. X          tt->date, &tt->uid,
  1211. X          &tt->level, &tt->maxlvl,
  1212. X          &tt->hp, &tt->maxhp, &tt->points,
  1213. X! #ifdef TOS
  1214. X          k1, k2,
  1215. X  #else
  1216. X          &tt->plchar, &tt->sex,
  1217. X--- 653,659 ----
  1218. X          tt->date, &tt->uid,
  1219. X          &tt->level, &tt->maxlvl,
  1220. X          &tt->hp, &tt->maxhp, &tt->points,
  1221. X! #ifdef OLD_TOS
  1222. X          k1, k2,
  1223. X  #else
  1224. X          &tt->plchar, &tt->sex,
  1225. X***************
  1226. X*** 626,632 ****
  1227. X          tt->name, tt->death) != 11)
  1228. X              tt->points = 0;
  1229. X        if(tt->points == 0) break;
  1230. X! #ifdef TOS
  1231. X        tt->plchar=k1[0];
  1232. X        tt->sex=k2[0];
  1233. X  #endif
  1234. X--- 661,667 ----
  1235. X          tt->name, tt->death) != 11)
  1236. X              tt->points = 0;
  1237. X        if(tt->points == 0) break;
  1238. X! #ifdef OLD_TOS
  1239. X        tt->plchar=k1[0];
  1240. X        tt->sex=k2[0];
  1241. X  #endif
  1242. X*** src/Old/trap.c    Wed Jul 19 04:10:30 1989
  1243. X--- src/trap.c    Mon Jul 31 21:56:52 1989
  1244. X***************
  1245. X*** 295,301
  1246. X              } else {
  1247. X              (void) mksobj_at(DART, u.ux, u.uy);
  1248. X              fobj->quan = 1;
  1249. X!             fobj->opoisoned = 1;
  1250. X              fobj->owt = weight(fobj);
  1251. X              }
  1252. X              break;
  1253. X
  1254. X--- 295,301 -----
  1255. X              } else {
  1256. X              (void) mksobj_at(DART, u.ux, u.uy);
  1257. X              fobj->quan = 1;
  1258. X!             if(!rn2(6)) fobj->opoisoned = 1;
  1259. X              fobj->owt = weight(fobj);
  1260. X              }
  1261. X              break;
  1262. X***************
  1263. X*** 689,694
  1264. X          case DART_TRAP:
  1265. X              otmp = mksobj(DART, FALSE);
  1266. X              otmp->quan = 1;
  1267. X              otmp->owt = weight(otmp);
  1268. X              if(thitm(7, mtmp, otmp, 0)) trapkilled = TRUE;
  1269. X              break;
  1270. X
  1271. X--- 689,695 -----
  1272. X          case DART_TRAP:
  1273. X              otmp = mksobj(DART, FALSE);
  1274. X              otmp->quan = 1;
  1275. X+             if (!rn2(6)) otmp->opoisoned = 1;
  1276. X              otmp->owt = weight(otmp);
  1277. X              if(thitm(7, mtmp, otmp, 0)) trapkilled = TRUE;
  1278. X              break;
  1279. X***************
  1280. X*** 943,949
  1281. X          u.uundetected = 0;
  1282. X      if (u.usym == S_MIMIC_DEF) u.usym = S_MIMIC;
  1283. X  #endif
  1284. X-     setsee();
  1285. X      if(Punished) placebc(1);
  1286. X      if(u.uswallow){
  1287. X          u.uswldtim = u.uswallow = 0;
  1288. X
  1289. X--- 944,949 -----
  1290. X          u.uundetected = 0;
  1291. X      if (u.usym == S_MIMIC_DEF) u.usym = S_MIMIC;
  1292. X  #endif
  1293. X      if(Punished) placebc(1);
  1294. X      if(u.uswallow){
  1295. X          u.uswldtim = u.uswallow = 0;
  1296. X***************
  1297. X*** 949,954
  1298. X          u.uswldtim = u.uswallow = 0;
  1299. X          docrt();
  1300. X      }
  1301. X      nomul(0);
  1302. X      spoteffects();
  1303. X  }
  1304. X
  1305. X--- 949,955 -----
  1306. X          u.uswldtim = u.uswallow = 0;
  1307. X          docrt();
  1308. X      }
  1309. X+     setsee();
  1310. X      nomul(0);
  1311. X      spoteffects();
  1312. X  }
  1313. X***************
  1314. X*** 1621,1626
  1315. X              if (dam < 1) dam = 1;
  1316. X          }
  1317. X          if ((mon->mhp -= dam) <= 0) {
  1318. X              if (cansee(mon->mx, mon->my))
  1319. X                  pline("%s is killed!", Monnam(mon));
  1320. X              else if (mon->mtame)
  1321. X
  1322. X--- 1622,1630 -----
  1323. X              if (dam < 1) dam = 1;
  1324. X          }
  1325. X          if ((mon->mhp -= dam) <= 0) {
  1326. X+             int xx = mon->mx;
  1327. X+             int yy = mon->my;
  1328. X+ 
  1329. X              if (cansee(mon->mx, mon->my))
  1330. X                  pline("%s is killed!", Monnam(mon));
  1331. X              else if (mon->mtame)
  1332. X***************
  1333. X*** 1626,1631
  1334. X              else if (mon->mtame)
  1335. X      You("have a sad feeling for a moment, then it passes.");
  1336. X              mondied(mon);
  1337. X              trapkilled = TRUE;
  1338. X          }
  1339. X      }
  1340. X
  1341. X--- 1630,1636 -----
  1342. X              else if (mon->mtame)
  1343. X      You("have a sad feeling for a moment, then it passes.");
  1344. X              mondied(mon);
  1345. X+             newsym(xx, yy);
  1346. X              trapkilled = TRUE;
  1347. X          }
  1348. X      }
  1349. X*** src/Old/uhitm.c    Mon Jul 31 14:50:00 1989
  1350. X--- src/uhitm.c    Mon Jul 31 09:20:24 1989
  1351. X***************
  1352. X*** 11,17 ****
  1353. X  #ifdef POLYSELF
  1354. X  static boolean hmonas();
  1355. X  #endif
  1356. X- static int passive();
  1357. X  
  1358. X  #ifdef WORM
  1359. X  extern boolean notonhead;
  1360. X--- 11,16 ----
  1361. X***************
  1362. X*** 26,32 ****
  1363. X  
  1364. X      mm.x = mon->mx;
  1365. X      mm.y = mon->my;
  1366. X!     enexto(&mm, mm.x, mm.y);
  1367. X      if (levl[mm.x][mm.y].mmask || mon->mhp <= 1) return (struct monst *)0;
  1368. X      m2 = newmonst(0);
  1369. X      *m2 = *mon;            /* copy condition of old monster */
  1370. X--- 25,31 ----
  1371. X  
  1372. X      mm.x = mon->mx;
  1373. X      mm.y = mon->my;
  1374. X!     enexto(&mm, mm.x, mm.y, mon->data);
  1375. X      if (levl[mm.x][mm.y].mmask || mon->mhp <= 1) return (struct monst *)0;
  1376. X      m2 = newmonst(0);
  1377. X      *m2 = *mon;            /* copy condition of old monster */
  1378. X***************
  1379. X*** 301,309 ****
  1380. X  register int thrown;
  1381. X  {
  1382. X      register int tmp;
  1383. X!     boolean hittxt = FALSE;
  1384. X      boolean get_dmg_bonus = TRUE;
  1385. X!     boolean ispoisoned = FALSE;
  1386. X  
  1387. X      wakeup(mon);
  1388. X      if(!obj) {
  1389. X--- 300,308 ----
  1390. X  register int thrown;
  1391. X  {
  1392. X      register int tmp;
  1393. X!     boolean hittxt = FALSE, destroyed = FALSE;
  1394. X      boolean get_dmg_bonus = TRUE;
  1395. X!     boolean ispoisoned = FALSE, needpoismsg = FALSE;
  1396. X  
  1397. X      wakeup(mon);
  1398. X      if(!obj) {
  1399. X***************
  1400. X*** 318,343 ****
  1401. X              mon_nam(mon), makeplural(body_part(HAND)));
  1402. X          You("turn to stone...");
  1403. X          done_in_by(mon);
  1404. X          }
  1405. X      } else {
  1406. X          if(obj->olet == WEAPON_SYM || obj->otyp == PICK_AXE ||
  1407. X             obj->olet == ROCK_SYM) {
  1408. X  
  1409. X-         if(mon->data == &mons[PM_RUST_MONSTER] && obj == uwep &&
  1410. X-             objects[obj->otyp].oc_material == METAL &&
  1411. X-             obj->spe > -2) {
  1412. X-             if(obj->rustfree) {
  1413. X-             pline("The rust on your %s vanishes instantly!",
  1414. X-                   is_sword(obj) ? "sword" : "weapon");
  1415. X-             } else if(obj->blessed && rnl(4))
  1416. X-             pline("Somehow your %s is not affected!",
  1417. X-                   is_sword(obj) ? "sword" : "weapon");
  1418. X-             else {
  1419. X-                 Your("%s!", aobjnam(uwep, "corrode"));
  1420. X-                 uwep->spe--;
  1421. X-             }
  1422. X-         }
  1423. X- 
  1424. X          if(obj == uwep && (obj->otyp > VOULGE || obj->otyp < BOOMERANG)
  1425. X                  && obj->otyp != PICK_AXE)
  1426. X              tmp = rnd(2);
  1427. X--- 317,328 ----
  1428. X              mon_nam(mon), makeplural(body_part(HAND)));
  1429. X          You("turn to stone...");
  1430. X          done_in_by(mon);
  1431. X+         hittxt = TRUE; /* maybe lifesaved */
  1432. X          }
  1433. X      } else {
  1434. X          if(obj->olet == WEAPON_SYM || obj->otyp == PICK_AXE ||
  1435. X             obj->olet == ROCK_SYM) {
  1436. X  
  1437. X          if(obj == uwep && (obj->otyp > VOULGE || obj->otyp < BOOMERANG)
  1438. X                  && obj->otyp != PICK_AXE)
  1439. X              tmp = rnd(2);
  1440. X***************
  1441. X*** 513,524 ****
  1442. X      }
  1443. X   */
  1444. X      if (ispoisoned) {
  1445. X-         /* OK to reference obj because ispoisoned can only be set
  1446. X-          * when obj is a throwing weapon */
  1447. X-         hit(xname(obj), mon, exclam(tmp));
  1448. X-         hittxt = TRUE;
  1449. X          if(resists_poison(mon->data))
  1450. X!         kludge("The poison doesn't seem to affect %s.", mon_nam(mon));
  1451. X          else if (rn2(10))
  1452. X          tmp += rnd(6);
  1453. X          else {
  1454. X--- 498,505 ----
  1455. X      }
  1456. X   */
  1457. X      if (ispoisoned) {
  1458. X          if(resists_poison(mon->data))
  1459. X!         needpoismsg = TRUE;
  1460. X          else if (rn2(10))
  1461. X          tmp += rnd(6);
  1462. X          else {
  1463. X***************
  1464. X*** 530,539 ****
  1465. X      if(tmp < 1) tmp = 1;
  1466. X  
  1467. X      mon->mhp -= tmp;
  1468. X!     if(mon->mhp < 1) {
  1469. X!         killed(mon);
  1470. X!         return(FALSE);
  1471. X!     }
  1472. X      if(mon->mtame && (!mon->mflee || mon->mfleetim)) {
  1473. X  #ifdef SOUNDS
  1474. X          if (rn2(8)) yelp(mon);
  1475. X--- 511,518 ----
  1476. X      if(tmp < 1) tmp = 1;
  1477. X  
  1478. X      mon->mhp -= tmp;
  1479. X!     if(mon->mhp < 1)
  1480. X!         destroyed = TRUE;
  1481. X      if(mon->mtame && (!mon->mflee || mon->mfleetim)) {
  1482. X  #ifdef SOUNDS
  1483. X          if (rn2(8)) yelp(mon);
  1484. X***************
  1485. X*** 544,552 ****
  1486. X          mon->mfleetim += 10*rnd(tmp);
  1487. X      }
  1488. X      if((mon->data == &mons[PM_BLACK_PUDDING] ||
  1489. X!            mon->data == &mons[PM_BROWN_PUDDING]) && uwep &&
  1490. X!            uwep == obj && objects[obj->otyp].oc_material == METAL
  1491. X!            && mon->mhp > 1 && !thrown && !mon->mcan) {
  1492. X  
  1493. X          if (clone_mon(mon)) {
  1494. X              pline("%s divides as you hit it!", Monnam(mon));
  1495. X--- 523,532 ----
  1496. X          mon->mfleetim += 10*rnd(tmp);
  1497. X      }
  1498. X      if((mon->data == &mons[PM_BLACK_PUDDING] ||
  1499. X!            mon->data == &mons[PM_BROWN_PUDDING]) && obj &&
  1500. X!            obj == uwep && objects[obj->otyp].oc_material == METAL
  1501. X!            && mon->mhp > 1 && !thrown && !mon->mcan
  1502. X!            /* && !destroyed  -- guaranteed by mhp > 1 */ ) {
  1503. X  
  1504. X          if (clone_mon(mon)) {
  1505. X              pline("%s divides as you hit it!", Monnam(mon));
  1506. X***************
  1507. X*** 554,560 ****
  1508. X          }
  1509. X      }
  1510. X  
  1511. X!     if(!hittxt) {
  1512. X          if(thrown)
  1513. X              /* thrown => obj exists */
  1514. X              hit(xname(obj), mon, exclam(tmp) );
  1515. X--- 534,540 ----
  1516. X          }
  1517. X      }
  1518. X  
  1519. X!     if(!hittxt && !destroyed) {
  1520. X          if(thrown)
  1521. X              /* thrown => obj exists */
  1522. X              hit(xname(obj), mon, exclam(tmp) );
  1523. X***************
  1524. X*** 562,568 ****
  1525. X          else    You("hit %s%s", mon_nam(mon), exclam(tmp));
  1526. X      }
  1527. X  
  1528. X!     if(u.umconf && !thrown) {
  1529. X          if(!Blind) {
  1530. X              Your("%s stop glowing %s.",
  1531. X              makeplural(body_part(HAND)),
  1532. X--- 542,553 ----
  1533. X          else    You("hit %s%s", mon_nam(mon), exclam(tmp));
  1534. X      }
  1535. X  
  1536. X!     if (needpoismsg)
  1537. X!         kludge("The poison doesn't seem to affect %s.", mon_nam(mon));
  1538. X! 
  1539. X!     if (destroyed)
  1540. X!         killed(mon);    /* takes care of messages */
  1541. X!     else if(u.umconf && !thrown) {
  1542. X          if(!Blind) {
  1543. X              Your("%s stop glowing %s.",
  1544. X              makeplural(body_part(HAND)),
  1545. X***************
  1546. X*** 574,580 ****
  1547. X              pline("%s appears confused.", Monnam(mon));
  1548. X          u.umconf = 0;
  1549. X      }
  1550. X!     return(TRUE);    /* mon still alive */
  1551. X  }
  1552. X  
  1553. X  #ifdef POLYSELF
  1554. X--- 559,581 ----
  1555. X              pline("%s appears confused.", Monnam(mon));
  1556. X          u.umconf = 0;
  1557. X      }
  1558. X! 
  1559. X!     if(mon->data == &mons[PM_RUST_MONSTER] && obj && obj == uwep &&
  1560. X!         objects[obj->otyp].oc_material == METAL &&
  1561. X!         obj->olet == WEAPON_SYM && obj->spe > -2) {
  1562. X!         if(obj->rustfree) {
  1563. X!         pline("The rust on your %s vanishes instantly!",
  1564. X!               is_sword(obj) ? "sword" : "weapon");
  1565. X!         } else if(obj->blessed && rnl(4))
  1566. X!         pline("Somehow your %s is not affected!",
  1567. X!               is_sword(obj) ? "sword" : "weapon");
  1568. X!         else {
  1569. X!         Your("%s!", aobjnam(obj, "corrode"));
  1570. X!         obj->spe--;
  1571. X!         }
  1572. X!     }
  1573. X! 
  1574. X!     return(destroyed ? FALSE : TRUE);
  1575. X  }
  1576. X  
  1577. X  #ifdef POLYSELF
  1578. X***************
  1579. X*** 911,922 ****
  1580. X          kludge("You engulf %s!", mon_nam(mdef));
  1581. X          switch(mattk->adtyp) {
  1582. X              case AD_DGST:
  1583. X!             u.uhunger += 20*mdef->mhpmax;
  1584. X              newuhs(FALSE);
  1585. X              xkilled(mdef,2);
  1586. X              Sprintf(msgbuf, "You totally digest %s.",
  1587. X                      Blind ? "it" : mon_nam(mdef));
  1588. X!             if ((tmp = mdef->mhpmax/5)) {
  1589. X                  kludge("You digest %s.", mon_nam(mdef));
  1590. X                  nomul(-tmp);
  1591. X                  nomovemsg = msgbuf;
  1592. X--- 912,923 ----
  1593. X          kludge("You engulf %s!", mon_nam(mdef));
  1594. X          switch(mattk->adtyp) {
  1595. X              case AD_DGST:
  1596. X!             u.uhunger += mdef->data->cnutrit;
  1597. X              newuhs(FALSE);
  1598. X              xkilled(mdef,2);
  1599. X              Sprintf(msgbuf, "You totally digest %s.",
  1600. X                      Blind ? "it" : mon_nam(mdef));
  1601. X!             if (tmp = 3 + (mdef->data->cwt >> 2)) {
  1602. X                  kludge("You digest %s.", mon_nam(mdef));
  1603. X                  nomul(-tmp);
  1604. X                  nomovemsg = msgbuf;
  1605. X***************
  1606. X*** 1170,1176 ****
  1607. X  
  1608. X  /*    Special (passive) attacks on you by monsters done here.        */
  1609. X  
  1610. X! static int
  1611. X  passive(mon, mhit, malive)
  1612. X  register struct monst *mon;
  1613. X  register boolean mhit;
  1614. X--- 1171,1177 ----
  1615. X  
  1616. X  /*    Special (passive) attacks on you by monsters done here.        */
  1617. X  
  1618. X! int
  1619. X  passive(mon, mhit, malive)
  1620. X  register struct monst *mon;
  1621. X  register boolean mhit;
  1622. X*** src/Old/unixmain.c    Mon Jul 31 14:51:12 1989
  1623. X--- src/unixmain.c    Sun Jul 30 18:19:38 1989
  1624. X***************
  1625. X*** 188,198 ****
  1626. X          (void) signal(SIGQUIT,SIG_IGN);
  1627. X          (void) signal(SIGINT,SIG_IGN);
  1628. X          if(!locknum)
  1629. X!             Strcpy(lock,plname);
  1630. X          getlock();    /* sets lock if locknum != 0 */
  1631. X  #ifdef WIZARD
  1632. X      } else
  1633. X!         Strcpy(lock,plname);
  1634. X  #endif /* WIZARD /**/
  1635. X      setftty();
  1636. X  
  1637. X--- 188,198 ----
  1638. X          (void) signal(SIGQUIT,SIG_IGN);
  1639. X          (void) signal(SIGINT,SIG_IGN);
  1640. X          if(!locknum)
  1641. X!             Sprintf(lock, "%d%s", getuid(), plname);
  1642. X          getlock();    /* sets lock if locknum != 0 */
  1643. X  #ifdef WIZARD
  1644. X      } else
  1645. X!         Sprintf(lock, "%d%s", getuid(), plname);
  1646. X  #endif /* WIZARD /**/
  1647. X      setftty();
  1648. X  
  1649. X*** src/Old/unixunix.c    Mon Jul 31 14:52:10 1989
  1650. X--- src/unixunix.c    Sat Jul 29 21:26:29 1989
  1651. X***************
  1652. X*** 15,24 ****
  1653. X--- 15,28 ----
  1654. X  
  1655. X  /* block some unused #defines to avoid overloading some cpp's */
  1656. X  #define MONATTK_H
  1657. X+ #define MONFLAG_H
  1658. X  #include "hack.h"    /* mainly for index() which depends on BSD */
  1659. X  
  1660. X  #include <errno.h>
  1661. X  #include <sys/stat.h>
  1662. X+ #ifdef NO_FILE_LINKS
  1663. X+ #include <fcntl.h>
  1664. X+ #endif
  1665. X  
  1666. X  void
  1667. X  setrandom()
  1668. X***************
  1669. X*** 215,220 ****
  1670. X--- 219,228 ----
  1671. X  {
  1672. X      extern int errno;
  1673. X      register int i = 0, fd;
  1674. X+ #ifdef NO_FILE_LINKS
  1675. X+     int hlockfd ;
  1676. X+     int sleepct = 20 ;
  1677. X+ #endif
  1678. X  
  1679. X  #ifdef HARD
  1680. X      /* idea from rpick%ucqais@uccba.uc.edu
  1681. X***************
  1682. X*** 230,235 ****
  1683. X--- 238,261 ----
  1684. X      (void) fflush(stdout);
  1685. X  
  1686. X      /* we ignore QUIT and INT at this point */
  1687. X+ #ifdef NO_FILE_LINKS
  1688. X+     while ((hlockfd = open(LLOCK,O_RDONLY|O_CREAT|O_EXCL,0644)) == -1) {
  1689. X+         if (--sleepct) {
  1690. X+         Printf( "Lock file in use.  %d retries left.\n",sleepct);
  1691. X+         (void) fflush(stdout);
  1692. X+ # if defined(SYSV) || defined(ULTRIX)
  1693. X+         (void)
  1694. X+ # endif
  1695. X+             sleep(1);
  1696. X+         } else {
  1697. X+         Printf("I give up!  Try again later.\n");
  1698. X+         getret();
  1699. X+         error("");
  1700. X+         }
  1701. X+     }
  1702. X+     (void) close(hlockfd);
  1703. X+ 
  1704. X+ #else    /* NO_FILE_LINKS */
  1705. X      if (link(HLOCK, LLOCK) == -1) {
  1706. X          register int errnosv = errno;
  1707. X  
  1708. X***************
  1709. X*** 252,257 ****
  1710. X--- 278,284 ----
  1711. X          error("");
  1712. X          /*NOTREACHED*/
  1713. X      }
  1714. X+ #endif /* NO_FILE_LINKS */
  1715. X  
  1716. X      regularize(lock);
  1717. X      glo(0);
  1718. X*** src/Old/vault.c    Mon Jul 31 14:52:40 1989
  1719. X--- src/vault.c    Wed Jul 26 12:01:14 1989
  1720. X***************
  1721. X*** 101,107 ****
  1722. X  
  1723. X      /* make something interesting happen */
  1724. X      if(!(guard = makemon(&mons[PM_GUARD], x, y))) return;
  1725. X!     guard->isgd = guard->mpeaceful = 1;
  1726. X      EGD->gddone = 0;
  1727. X      gdlevel = dlevel;
  1728. X      if(!cansee(guard->mx, guard->my)) {
  1729. X--- 101,108 ----
  1730. X  
  1731. X      /* make something interesting happen */
  1732. X      if(!(guard = makemon(&mons[PM_GUARD], x, y))) return;
  1733. X!     guard->isgd = 1;
  1734. X!     guard->mpeaceful = 1;
  1735. X      EGD->gddone = 0;
  1736. X      gdlevel = dlevel;
  1737. X      if(!cansee(guard->mx, guard->my)) {
  1738. X***************
  1739. X*** 177,184 ****
  1740. X          /* seems we found a good place to leave him alone */
  1741. X          EGD->gddone = 1;
  1742. X          if(ACCESSIBLE(typ)) goto newpos;
  1743. X! 
  1744. X          crm->typ = (typ == SCORR) ? CORR : DOOR;
  1745. X          if(crm->typ == DOOR) crm->doormask = D_NODOOR;
  1746. X          goto proceed;
  1747. X          }
  1748. X--- 178,191 ----
  1749. X          /* seems we found a good place to leave him alone */
  1750. X          EGD->gddone = 1;
  1751. X          if(ACCESSIBLE(typ)) goto newpos;
  1752. X! #ifdef STUPID
  1753. X!         if (typ == SCORR)
  1754. X!             crm->typ = CORR;
  1755. X!         else
  1756. X!             crm->typ = DOOR;
  1757. X! #else
  1758. X          crm->typ = (typ == SCORR) ? CORR : DOOR;
  1759. X+ #endif
  1760. X          if(crm->typ == DOOR) crm->doormask = D_NODOOR;
  1761. X          goto proceed;
  1762. X          }
  1763. X*** src/Old/zap.c    Sat Jul 22 08:19:59 1989
  1764. X--- src/zap.c    Mon Jul 31 21:56:58 1989
  1765. X***************
  1766. X*** 245,250
  1767. X  #ifdef SPELLS
  1768. X      case SPE_POLYMORPH:
  1769. X  #endif
  1770. X  #ifdef MAIL
  1771. X          /* You can't send yourself 100 mail messages and then
  1772. X           * polymorph them into useful scrolls
  1773. X
  1774. X--- 245,253 -----
  1775. X  #ifdef SPELLS
  1776. X      case SPE_POLYMORPH:
  1777. X  #endif
  1778. X+         /* preserve symbol and quantity */
  1779. X+         otmp2 = mkobj_at(obj->olet, obj->ox, obj->oy);
  1780. X+         otmp2->quan = obj->quan;
  1781. X  #ifdef MAIL
  1782. X          /* You can't send yourself 100 mail messages and then
  1783. X           * polymorph them into useful scrolls
  1784. X***************
  1785. X*** 249,255
  1786. X          /* You can't send yourself 100 mail messages and then
  1787. X           * polymorph them into useful scrolls
  1788. X           */
  1789. X!         if (obj->otyp == SCR_MAIL) obj->spe = 1;
  1790. X  #endif
  1791. X          /* preserve symbol and quantity */
  1792. X          otmp2 = mkobj_at(obj->olet, obj->ox, obj->oy);
  1793. X
  1794. X--- 252,261 -----
  1795. X          /* You can't send yourself 100 mail messages and then
  1796. X           * polymorph them into useful scrolls
  1797. X           */
  1798. X!         if (obj->otyp == SCR_MAIL) {
  1799. X!             otmp2->otyp = SCR_MAIL;
  1800. X!             obj->spe = 1;
  1801. X!         }
  1802. X  #endif
  1803. X          /* keep special fields (including charges on wands) */
  1804. X          if (index(charged_objs, otmp2->olet)) otmp2->spe = obj->spe;
  1805. X***************
  1806. X*** 251,260
  1807. X           */
  1808. X          if (obj->otyp == SCR_MAIL) obj->spe = 1;
  1809. X  #endif
  1810. X-         /* preserve symbol and quantity */
  1811. X-         otmp2 = mkobj_at(obj->olet, obj->ox, obj->oy);
  1812. X-         otmp2->quan = obj->quan;
  1813. X- 
  1814. X          /* keep special fields (including charges on wands) */
  1815. X          if (index(charged_objs, otmp2->olet)) otmp2->spe = obj->spe;
  1816. X  
  1817. X
  1818. X--- 257,262 -----
  1819. X              obj->spe = 1;
  1820. X          }
  1821. X  #endif
  1822. X          /* keep special fields (including charges on wands) */
  1823. X          if (index(charged_objs, otmp2->olet)) otmp2->spe = obj->spe;
  1824. X  
  1825. X***************
  1826. X*** 1226,1232
  1827. X  #ifdef MSDOSCOLOR
  1828. X      Tmp_at2(-3, (int)(abstype == 1 ? AT_RED :    /* fire */
  1829. X                abstype == 3 || abstype == 5 ? AT_WHITE :    /* cold/elec */
  1830. X!               AT_ZAP);
  1831. X  #endif
  1832. X      while(range-- > 0) {
  1833. X          sx += dx;
  1834. X
  1835. X--- 1228,1234 -----
  1836. X  #ifdef MSDOSCOLOR
  1837. X      Tmp_at2(-3, (int)(abstype == 1 ? AT_RED :    /* fire */
  1838. X                abstype == 3 || abstype == 5 ? AT_WHITE :    /* cold/elec */
  1839. X!               AT_ZAP));
  1840. X  #endif
  1841. X      while(range-- > 0) {
  1842. X          sx += dx;
  1843. X***************
  1844. X*** 1589,1595
  1845. X      do {
  1846. X          tx = rn1(COLNO-3,2);
  1847. X          ty = rn2(ROWNO);
  1848. X!     } while(!goodpos(tx,ty));
  1849. X      obj->ox = tx;
  1850. X      obj->oy = ty;
  1851. X      set_omask(otx,oty);
  1852. X
  1853. X--- 1591,1597 -----
  1854. X      do {
  1855. X          tx = rn1(COLNO-3,2);
  1856. X          ty = rn2(ROWNO);
  1857. X!     } while(!goodpos(tx,ty,(struct permonst *)0));
  1858. X      obj->ox = tx;
  1859. X      obj->oy = ty;
  1860. X      set_omask(otx,oty);
  1861. X***************
  1862. X*** 1606,1612
  1863. X  {
  1864. X      /* unpobj(obj); */
  1865. X      obj->otyp = ROCK;
  1866. X-     obj->blessed = FALSE;
  1867. X      obj->quan = 7 + rn2(60);
  1868. X      obj->owt = weight(obj);
  1869. X      obj->olet = GEM_SYM;
  1870. X
  1871. X--- 1608,1613 -----
  1872. X  {
  1873. X      /* unpobj(obj); */
  1874. X      obj->otyp = ROCK;
  1875. X      obj->quan = 7 + rn2(60);
  1876. X      obj->owt = weight(obj);
  1877. X      obj->olet = GEM_SYM;
  1878. END_OF_FILE
  1879. if test 48599 -ne `wc -c <'src4.diff'`; then
  1880.     echo shar: \"'src4.diff'\" unpacked with wrong size!
  1881. fi
  1882. # end of 'src4.diff'
  1883. fi
  1884. echo shar: End of archive 6 \(of 6\).
  1885. cp /dev/null ark6isdone
  1886. MISSING=""
  1887. for I in 1 2 3 4 5 6 ; do
  1888.     if test ! -f ark${I}isdone ; then
  1889.     MISSING="${MISSING} ${I}"
  1890.     fi
  1891. done
  1892. if test "${MISSING}" = "" ; then
  1893.     echo You have unpacked all 6 archives.
  1894.     echo "now type ./do_patch.sh"
  1895.     rm -f ark[1-9]isdone
  1896. else
  1897.     echo You still need to unpack the following archives:
  1898.     echo "        " ${MISSING}
  1899. fi
  1900. ##  End of shell archive.
  1901. exit 0
  1902.